package com.lyz.anli;

import java.util.Arrays;

/**
 * 评委打分
 *  6名评委打分，分数[0~100]之间的整数
 *  去掉最高与最低分，求平均分
 */
public class De5pwdf {
    public static void main(String[] args) {
        int[] arr = new int[6];
        int da = 0;
        int xiao = 100;
        for (int i = 0; i < arr.length; i++) {
            arr[i]=(int)(Math.random()*100+1);
            if(da<arr[i]){
                da=arr[i];
            }
            if(xiao>arr[i]){
                xiao=arr[i];
            }
        }
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        sum=(sum-da-xiao)/(arr.length-2);
        System.out.println("平均分："+sum);
        System.out.println(Arrays.toString(arr));
    }
}
